#include "../Basics/BasicStruct.cpp"

// 层次遍历
queue<TreeNode*> Q;

void LayerPrint(TreeNode* bt) {
    initTreeQueue(Q);
    enterTreeQueue(Q,bt);
    while(!EmptyTreeQueue(Q)) {
        TreeNode *p = deleteTreeQueue(Q);
        if (p != NULL) {
            printf("%d ",p->data);
            enterTreeQueue(Q,p->leftChild);
            enterTreeQueue(Q,p->rightChild);
        }
    }
}

int main(){
    Tree tree = CreateTree();
    LayerPrint(tree);
}

